﻿using System;
using TechMadeira.Core.Command;

namespace TechMadeira.Data.Commands
{
    public class CommandSetOrderNumber : ICommand
    {
        public CommandSetOrderNumber( IOrder aOrder, int aNumber )
        {
            Order  = aOrder;
            Number = aNumber;
        }

        public IOrder Order { get; set; }

        public int Number { get; set; }

        public void Execute()
        {
            Undo();
        }

        public void Undo()
        {
            int number = Order.Number;
            Order.Number = Number;
            Number = number;
        }

        public void Redo()
        {
            Undo();
        }

        public void Abort()
        {
        }
    }
}
